package blackithei.UDP;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;

//UDP 组播
//顾客
public class ClientDemo2 {
    public static void main(String[] args) throws IOException {
        //寻找组播码头
        MulticastSocket ms=new MulticastSocket();
        //创建包裹
        byte[] bytes = "美丽的姑娘".getBytes();
        DatagramPacket dp=new DatagramPacket(bytes,bytes.length, InetAddress.getByName("224.0.1.0"),10001);
        //传输
        ms.send(dp);
        //释放资源
        ms.close();

    }
}
